<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <div class="layui-card">
        <div class="layui-card-header well">
            <div class="layui-col-xs6 m-bottom-sm">
                <h3>{:lang('ADMIN_NAV_INDEX')}</h3>
            </div>
            <div class="layui-col-xs6 text-right">
                <!-- 添加 -->
                <if condition="in_array('add', $actions)">
                    <a href="{:url('Nav/add')}" class="layui-btn layui-btn-normal">{:lang('ADMIN_NAV_ADD')}</a>
                </if>
            </div>
        </div>

        <form action="{:url('Rbac/listorders')}" method="post" class="margin-top-20">
            <php> $is_main=array("1"=>'是',"0"=>'否');</php>
            <div class="layui-card-body">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="40">ID</th>
                        <th>名称</th>
                        <th width="80">主导航</th>
                        <th>描述</th>
                        <th width="180">{:lang('ACTIONS')}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="navs" item="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>{$is_main[$vo.is_main]}</td>
                            <td>{$vo.remark}</td>
                            <td>
                                <if condition="cmf_auth_check(cmf_get_current_admin_id(), 'admin/NavMenu/index')">
                                    <a href="javascript:parent.openIframeLayer('{:url('NavMenu/index',array('nav_id'=>$vo['id']))}','{$vo.name}菜单管理',{});" class="layui-btn layui-btn-normal layui-btn-xs">菜单管理</a>
                                </if>
                                <if condition="in_array('edit', $actions)">
                                    <a href="{:url('nav/edit',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs">{:lang('EDIT')}</a>
                                </if>
                                <if condition="in_array('delete', $actions)">
                                    <a class="js-ajax-delete layui-btn layui-btn-danger layui-btn-xs" href="{:url('nav/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                                </if>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>
<include file="public@footer"/>
